<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>v-model</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<h1>v-model:为元素绑定值(双向数据绑定)</h1>
<div id="app">
  <label>
    <input type="text" v-model="msg" @keydown="cg">
  </label>
</div>
<script>
  new Vue({
    el: '#app',
    data: {
      msg: 'Hello Vue!'
    },
    methods:{
      cg(){
        console.log(this.msg)
      }
    }
  })
</script>
</body>
</html>